@model ShivamEMR.Model.Domain.UserDomain.UserRight

@* This partial view defines form fields that will appear when creating and editing entities *@

<div class="editor-label">
    @Html.LabelFor(model => model.RightCode)
</div>
<div class="editor-field">
    @Html.EditorFor(model => model.RightCode)
    @Html.ValidationMessageFor(model => model.RightCode)
</div>

<div class="editor-label">
    @Html.LabelFor(model => model.Title)
</div>
<div class="editor-field">
    @Html.EditorFor(model => model.Title)
    @Html.ValidationMessageFor(model => model.Title)
</div>

<div class="editor-label">
    @Html.LabelFor(model => model.Description)
</div>
<div class="editor-field">
    @Html.EditorFor(model => model.Description)
    @Html.ValidationMessageFor(model => model.Description)
</div>

<div class="editor-label">
    @Html.LabelFor(model => model.Target)
</div>
<div class="editor-field">
    @Html.EditorFor(model => model.Target)
    @Html.ValidationMessageFor(model => model.Target)
</div>

<div class="editor-label">
    @Html.LabelFor(model => model.Weight)
</div>
<div class="editor-field">
    @Html.EditorFor(model => model.Weight)
    @Html.ValidationMessageFor(model => model.Weight)
</div>

<div class="editor-label">
    @Html.LabelFor(model => model.Notes)
</div>
<div class="editor-field">
    @Html.EditorFor(model => model.Notes)
    @Html.ValidationMessageFor(model => model.Notes)
</div>

<div class="editor-label">
    Type
</div>
<div class="editor-field">
    @Html.DropDownListFor(model => model.TypeID, ((IEnumerable<ShivamEMR.Model.Domain.UserDomain.UserRightType>)ViewBag.PossibleTypes).Select(option => new SelectListItem {
        Text = Html.DisplayTextFor(_ => option.Type).ToString(), 
        Value = option.ID.ToString(),
        Selected = (Model != null) && (option.ID == Model.TypeID)
    }), "Choose...")
    @Html.ValidationMessageFor(model => model.TypeID)
</div>
<div class="editor-label">
    Group
</div>
<div class="editor-field">
    @Html.DropDownListFor(model => model.GroupID, ((IEnumerable<ShivamEMR.Model.Domain.UserDomain.UserRightGroup>)ViewBag.PossibleGroups).Select(option => new SelectListItem {
        Text = Html.DisplayTextFor(_ => option.Group).ToString(), 
        Value = option.ID.ToString(),
        Selected = (Model != null) && (option.ID == Model.GroupID)
    }), "Choose...")
    @Html.ValidationMessageFor(model => model.GroupID)
</div>
